import request from '@/utils/request'
import {
  req
} from './axiosFun'

export function login(data) {
  return request({
    url: '/vue-admin-template/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: {
      token
    }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}


export function getOutline(data) {
  return request({
    url: '/outline/findByItemId',
    method: 'post',
    data
  })
}

export function getAllStudent(data) {
  return request({
    url: '/student/findAll',
    method: 'post',
    data
  })
}

export function getAbilityModel(data) {
  return request({
    url: '/item/findAMById',
    method: 'post',
    data
  })
}

export function updateAbilityModel(data) {
  return request({
    url: '/item/updateAbilityModel',
    method: 'post',
    data
  })
}

export function getAppliedStudent(data) {
  return request({
    url: '/student/findApplied',
    method: 'post',
    data
  })
}
export function getList(data) {
    return request({
      url: '/item/findItem',
      method: 'post',
      data:data
    })
  }

  export function deleteOne(itemId) {
    return request({
      url: '/item/deleteOne/'+itemId,
      method: 'delete',
    })
  }

  export function findById(itemId) {
    return request({
      url: '/item/findById/'+itemId,
      method: 'post',
    })
  }

  export function addItem(EtmsItemAbilityOutline) {
    return request({
      url: '/item/addItem',
      method: 'post',
      data:EtmsItemAbilityOutline
    })
  }

  export function getItem(data) {
    return request({
      url: '/item/findById/'+data,
      method: 'post',
    })
  }

  export function agree(data) {
    return request({
      url: '/student/agree/'+data,
      method: 'post',
    })
  }

  export function reject(data) {
    return request({
      url: '/student/reject/'+data,
      method: 'post',
    })
  }

  export function deleteStu(data) {
    return request({
      url: '/student/delete/'+data,
      method: 'post',
    })
  }

  //查询此次培训大纲中所有的信息
  export function findOutlineInfo(data){
    return request({
      url: '/item/findCatalogInfo',
      method: "post",
      data
    })
  }

  //打开你选择的对应视频
  export function openClassVideo(data){
    return request({
      url: '/item/openClassFile',
      method: "post",
      data
    })
  }

  //得到对应培训的详情(培训进度,每个目录的详情)
  export function findScheduleAndHour(data){
    return request({
      url: '/item/findScheduleAndHour',
      method: "post",
      data
    })
  }

  //记录视频进度
  export function recordVideoProgress(data){
    return request({
      url: '/item/recordVideoProgress',
      method: 'post',
      data
      })}
  export function updateItem(data){
    return request({
      url: '/item/update',
      method: "post",
      data
    })
  }


  export function DeleteItemByUid(data){
    return request({
      url: '/item/DeleteItemByUid',
      method: "post",
      data
    })
  }

  export function updateItemSchedule(data){
    return request({
      url: '/item/updateItemSchedule',
      method: 'post',
      data
    })
  }
